package com.changxianggu.cloud.crawler.core.modules.storage.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jetbrains.annotations.TestOnly;

/**
 * <p>
 *
 * </p>
 *
 * @author liuyuantao
 * @since 2020-02-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("cxg_book")
public class CxgBook extends Model<CxgBook> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 出版社存的id
     */
    @TableField("pk_id")
    private String pkId;

    /**
     * ISBN
     */
    @TableField("book_isbn")
    private String bookIsbn;

    /**
     * 书名
     */
    @TableField("book_name")
    private String bookName;

    /**
     * 字数
     */
    @TableField("word_num")
    private Integer wordNum;

    /**
     * 页数
     */
    @TableField("page_num")
    private Integer pageNum;

    /**
     * 作者
     */
    @TableField("author")
    private String author;

    /**
     * 定价
     */
    @TableField("price")
    private BigDecimal price;

    /**
     * 封面地址
     */
    @TableField("cover")
    private String cover;

    /**
     * 电子书阅读地址
     */
    @TableField("digital_uri")
    private String digitalUri;

    /**
     * 出版社名
     */
    @TableField("press_name")
    private String pressName;

    /**
     * 获奖信息或丛书信息
     */
    @TableField("awards")
    private String awards;

    /**
     * 目录
     */
    @TableField("catalog")
    private String catalog;

    /**
     * 简介
     */
    @TableField("brief")
    private String brief;

    /**
     * 状态
     */
    @TableField("status")
    private Integer status;

    /**
     * 出版时间
     */
    @TableField("pub_date")
    private LocalDateTime pubDate;

    /**
     * 抓取时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 印次
     */
    @TableField("print_version")
    private String printVersion;

    /**
     * 班次
     */
    @TableField("book_version")
    private String bookVersion;

    /**
     * 是否已同步
     */
    @TableField("is_sync")
    private Integer isSync;

    /**
     * 出版社id
     */
    @TableField("press_id")
    private Integer pressId;


    /**
     * 课件地址
     */
    @TableField("courseware_uri")
    private String coursewareUri;

    @TableField(exist = false)
    private Integer isbnCount;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
